//logs.js
const app = getApp();
Page({
  data: {
    url: '',
    isFinish:false,
  },
  onLoad: function (value) {
    var that = this;
    console.log(value);
    // if (decodeURIComponent(value.url) != "https://dwelt.busbox.com.cn/neccmp/?key=2018102401"){
      if (!value.title){
        value.title = "前往官方网站中";
      }
    wx.showLoading({ title: value.title });
    // }
    this.setData({
      url:decodeURIComponent(value.url)
      })
    setTimeout(function () {
      // if (that.data.url == "https://dwelt.busbox.com.cn/neccmp/?key=2018102401") {
        wx.hideLoading();
      // }
    }, 3000);
    console.log(this.data.url);
  },
  load(e){
    // if (data.url == "https://www.ciie.org/ciie/f/exhibits-show/index"){
    //   console.log("重新加载");
    //   this.setData({
    //     url: decodeURIComponent(value.url)
    //   })
    // };
    wx.hideLoading();
    this.setData({
      isFinish: true
    })
  	console.log(e);
  },
  loadError(e){
    console.log("加载失败");
    wx.hideLoading();
    this.setData({
      url: decodeURIComponent(value.url),
      isFinish: true
    })
  } ,
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var that = this;
    return {
      title: app.globalData.shareTitle,
      path: app.globalData.sharePath,
      imageUrl: '../../images/share_img.png',
      success: function (res) {
        // 转发成功
      },
      fail: function (res) {
        // 转发失败
      }
    }
  },
})
